/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.googlecode.jmicroerp.wicket.administrare;
    
import com.googlecode.jmicroerp.model.Apometre;
import com.googlecode.jmicroerp.wicket.DefaultPageTemplate;
import com.googlecode.jmicroerp.wicket.components.grid.ActionButton;
import com.googlecode.jmicroerp.wicket.components.grid.ActionButtons;
import com.googlecode.jmicroerp.wicket.components.grid.ColumnModel;
import com.googlecode.jmicroerp.wicket.components.grid.DefaultGridAction;
import com.googlecode.jmicroerp.wicket.components.grid.Grid;
import com.googlecode.jmicroerp.wicket.components.grid.PageParameters;
import java.util.Date;
//import java.text.SimpleDateFormat;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import org.apache.wicket.spring.injection.annot.SpringBean;

/**
 *
 * @author Alexandru.Codescu
 */
public class VizualizareApometrePage extends DefaultPageTemplate {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@SpringBean(name = "defaultGridAction")
    private DefaultGridAction<Apometre> gridAction;
    
    
    public VizualizareApometrePage() {
        
        @SuppressWarnings("unchecked")
		ColumnModel[] grids = {
            new ColumnModel<String>("Recipient", "recipient.denumire", String.class),
            new ColumnModel<Date>("Data Citirii", "dataCitirii", Date.class),
            new ColumnModel<BigDecimal>("Valoare", "valoare", BigDecimal.class)
        };
        List<ColumnModel> columns = Arrays.asList(grids);
        ActionButton actionButton = new ActionButton(new PageParameters(EditareApometrePage.class));
        ActionButtons actionButtons = new ActionButtons(actionButton);
        Grid<Apometre> dataGridConsum = new Grid<Apometre>("grid", columns, Apometre.class, gridAction, actionButtons);
        add(dataGridConsum);
    }
}